package edu.iyte.ceng316.ui.phonebook.right;

import javax.swing.JPanel;

import edu.iyte.ceng316.ui.phonebook.mediator.IPhoneBookMediator;


import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

public class TopPanel extends JPanel {
     PersonButtonPanel pbp;
     PersonInfoPanel pip;
     
     IPhoneBookMediator iPhoneBookMediator;
	/**
	 * Create the panel.
	 */
	public TopPanel() {
		
		 pbp = new PersonButtonPanel();
		 pip = new PersonInfoPanel();
		
		GridBagLayout gridBagLayout = new GridBagLayout();
		
		gridBagLayout.columnWidths = new int[] { 0, 0 };
		gridBagLayout.rowHeights = new int[] { 0, 0, 0 };
		gridBagLayout.columnWeights = new double[] { 1.0, 1.0E-4 };
		gridBagLayout.rowWeights = new double[] { 0.0, 1.0, 1.0E-4 };
		setLayout(gridBagLayout);
		
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.fill = GridBagConstraints.NORTHWEST;
		gbc.gridx = 0;
		gbc.gridy = 0;
		//gbc.insets = new Insets(0, 0, 5, 0);
		add(pbp, gbc);

		GridBagConstraints gbc2 = new GridBagConstraints();
		gbc2.fill = GridBagConstraints.BOTH;
		gbc2.gridx = 0;
		gbc2.gridy = 1;
		add(pip, gbc2);

	}
	public PersonButtonPanel getPersonButtonPanel() {
		return pbp;
	}
	public void setPersonButtonPanel(PersonButtonPanel pbp) {
		this.pbp = pbp;
	}
	public PersonInfoPanel getPersonInfoPanel() {
		return pip;
	}
	public void setPersonInfoPanel(PersonInfoPanel pip) {
		this.pip = pip;
	}
	public void setIPhoneBookMediator(IPhoneBookMediator iPhoneBookMediator) {
		this.iPhoneBookMediator = iPhoneBookMediator;
		pbp.setIPhoneBookMediator(iPhoneBookMediator);
		pip.setIPhoneBookMediator(iPhoneBookMediator);
	}

}
